var footer={
	init:function(){
		var html="<footer class='mui-row w bGWhite'><div class='mui-col-xs-3 tC index'><img src='../img/icon/index1.png'/>"
				+"<p >首页</p></div><div class='mui-col-xs-3 tC found'><img src='../img/icon/found1.png'/>"
				+"<p >发现</p></div><div class='mui-col-xs-3 tC index-cart'><div class='pSR dIB'>	<img src='../img/icon/cart1.png'/><i class='cWhite' style='font-size:12px'>0</i></div>"
				+"<p >购物袋</p></div><div class='mui-col-xs-3 tC comm'><div class='pSR dIB'><img src='../img/icon/per1.png'/></div>"
				+"<p >红人</p></div></footer>";
		$('body').append(html);
		$('body').on('click','footer .index-cart',function(){
    		app.open('cart.html',{},window.location.href,document.body.scrollTop)
    	});
    	
    	app.ajax(
    		'/Goods/Cart/count_cart',
    		null,
    		function(res){
    			if(res.code ==200){
    				if(res.count){
    					$('footer .index-cart i').text(res.count);
    				}else{
    					$('footer .index-cart i').text(0);
    				}
    			}
    		}
    	);
    	$('body').on('click','footer .index',function(){
    		app.open('main.html',{},window.location.href,document.body.scrollTop);
    	});
    	
    	$('body').on('click','footer .found',function(){
    		app.open('found.html',{},window.location.href,document.body.scrollTop);
    	});
    	
    	$('body').on('click','footer .comm',function(){
    		app.open('user.personal.html',{},window.location.href,document.body.scrollTop);
    	});
	}
}
